package com.jf.yytgd.web;

import com.jf.yytgd.entity.dto.comment.CommentCreateDTO;
import com.jf.yytgd.service.CommentService;
import com.jf.yytgd.utils.Msg;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA
 * Description: 评论控制层
 * User:22954
 * Date:2025-02-10
 * Time:1:41
 */
@RequestMapping("/comment")
@RestController
public class CommentController {
    @Resource
    private CommentService commentService;
    @PostMapping("/comment")
    public Msg comment(@RequestBody @Validated CommentCreateDTO comment){
        commentService.comment(comment);
        return Msg.success();
    }
}
